package util

import (
	"likeadmin/core"
	"time"
)

func DateToTimestamp(dateStr string) (timestamp int64, err error) {
	layout := "2006-01-02"
	t, err := time.Parse(layout, dateStr)
	if err != nil {
		core.Logger.Errorf("DateToTimestamp err: err=[%+v]", err)
		return
	}
	timestamp = t.Unix()
	return
}
